//
//  main.java
//  
//
//  Created by tison on 09/11/09.
//  Copyright 2009 __FIL__. All rights reserved.
//
package NP;
import java.io.*;
import java.util.*;

public class testSum{
 
public static void main(String[] args) throws Exception {
 	if (args.length < 2){
	    System.out.println("Usage: java  <files>  <mode>");
		System.out.println("where modes include:  -nd (non d�terministe), -exh (exhaustif)");}
	
	else {
		BufferedReader donnee  //le fichier qui contient les donn�es du pb
              = new BufferedReader (new FileReader(args[0]));
                       String  u=donnee.readLine();
                       int nbEntiers=Integer.parseInt(u);
					   int lesEntiers[]=new int[nbEntiers];
                       for (int i=0;i< nbEntiers;i++) lesEntiers[i]=Integer.parseInt(donnee.readLine());
				       int cible=Integer.parseInt(donnee.readLine());
					   
	PblSum pb=new PblSum(nbEntiers,lesEntiers,cible);
    if (args[1].equals("-exh")) System.out.println(pb.aUneSolution());
	else if (args[1].equals("-nd")) System.out.println(pb.aUneSolutionNonDeterministe());
	else System.out.println("mode non pris en charge");
	 
  }
}

}